home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gzip124.gz / gzip124 / gzip-1.2.4 / sample / ztouch < prev   
Text File  |  1993-05-27  |  384b  |  16 lines

  1. #! /usr/local/bin/perl
  2. # Set the time stamp of a gzip'ed file from that stored in the file.
  3. # usage: ztouch files...
  4.  
  5. foreach $file (@ARGV) {
  6.     open (FILE, $file);
  7.     read (FILE, $_, 8);
  8.     ($magic, $method, $flags, $time) = unpack ("A2C2V", $_);
  9.     if ($magic eq "\037\213") {
  10.     utime ($time, $time, $file);
  11.     }
  12.     else {
  13.     warn "$file is not compressed with gzip!\n";
  14.     }
  15. }
  16.